t2_version = 0x00ff
t2_author = 0x00ff
t2_framework = 0x00ff
t2_manufacture = 0x00ff


def construct_t2_t3_data(tx, data):
    return b"aabbcc"


if __name__ == '__main__':
    file_path = 'C:\\Users\\latefly\\Desktop\\IotSolution\\2-Embed\\MicroBootloader\\stm32f103c8\\AppLed\\OBJ\\AppLed.bin'

    result = b''
    file = open(file_path, 'rb')
    framework = file.read()
    file.close()

    version = bytes([0x01, 0x00, 0x01])
    author = bytes("latefly", "utf-8")
    manufacture = bytes("mrike", "utf-8")

    result += construct_t2_t3_data(t2_author, author)
    result += version
    result += manufacture
    result += framework

    file = open(
        'C:\\Users\\latefly\\Desktop\\IotSolution\\2-Embed\\MicroBootloader\\stm32f103c8\\AppLed\\OBJ\\AppLed_framework.abin',
        'wb')

    # print(result)
    file.write(result)
    file.close()
